<template>
    <div class="adminMenuList-div">
        <el-card class="box-card">
            <div slot="header" class="clearfix">
                <div>
                    <el-input placeholder="搜索" suffix-icon="el-icon-search">
                    </el-input>
                </div>
                <div>
                    <el-button type="info" @click="init()" icon="el-icon-refresh-right">刷新</el-button>
                </div>
            </div>
            <div class="text item">
                <MyCollapse :adminMenuList="adminMenuList"></MyCollapse>
            </div>
        </el-card>
    </div>
</template>

<script>
import MyCollapse from '@/components/MyCollapse'
export default {
    name: "AdminMenuList",
    components: {
        MyCollapse
    },
    data() {
        return {

        }
    },
    mounted() {
        this.init()
    },
    methods: {
        async init() {
            let res = await this.$store.dispatch('getAdminMenuList')
            if (!res.success) this.$message.error(res.message)
        }
    },
    computed: {
        adminMenuList() {
            return this.$store.state.menu.adminMenuList
        }
    }
}
</script>

<style scoped>
.clearfix {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pagination {
    padding: 20px 0 10px 0;
    text-align: center;
}
</style>